<!-- 生命体征 -->

<template>
	<div>
		<table-no-height
			:dataSource="dataSource"
			:tableColumns="tableColumns"
			:height="500"
		></table-no-height>
	</div>
</template>

<script>
	import tableNoHeight from "@/components/customComponents/customeTable/tableNoHeight"
	import { AjaxCommon } from "@/libs/apiCommon"
	import { PopupCommon } from "@/libs/popupCommon"
	export default {
		props: ["userInfo", "type", "isFirst"],
		components: {
			tableNoHeight,
		},
		data() {
			return {
				dataSource: [],
				tableColumns: [
					{
						prop: "monitorBeginTime",
						label: "监测开始时间",
						width: 160,
					},
					{
						prop: "monitorEndTime",
						label: "监测结束时间",
						width: 160,
					},
					{
						prop: "sbp",
						label: "收缩压(mmHg)",
						width: 120,
					},
					{
						prop: "dbp",
						label: "舒张压(mmHg)",
						width: 120,
					},
					{
						prop: "bbt",
						label: "体温(℃)",
						width: 80,
					},
					{
						prop: "arm",
						label: "手臂",
						width: 60,
            dictName: "collect_fingers",
					},
					{
						prop: "pulse",
						label: "脉搏(次/分)",
						width: 100,
					},
					{
						prop: "createByName",
						label: "监测人",
						width: 80,
					},
					{
						prop: "csJudge",
						label: "异常值临床判断",
						width: 120,
            dictName: "cs_judge",
					},
					{
						prop: "remarks",
						label: "异常备注",
						width: 140,
					},
          {
            // todo 暂时不知道值以及作用
            prop: "",
            label: "记录标识",
            width: 80,
          },
				],
			}
		},
		methods: {
			// 初始化事件
			initPage() {
				let self = this
				let url =
					this.type == "filter"
						? "/ccdc/pm/em/filter/emFilterVitaSighs/listByPage"
						: "/ccdc/pm/em/in/emInVitaSighsRecord/listByPage"
				// 这里的isFirst 不一定是boolen类型
				let first = this.isFirst ? true : false
				AjaxCommon(
					url,
					"post",
					{
            examineeCodeList: [self.userInfo.examineeCode],
						pageNo: 1,
						pageSize: 1000,
					},
					first
				).then((res) => {
					if (res.data.code == 200) {
						self.dataSource = res.data.result.records
						self.pageCount = res.data.result.total
					} else {
						PopupCommon.notify("error", res.data.message)
					}
				})
			},
		},
		mounted() {
			this.initPage()
		},
	}
</script>
